﻿/// <reference path="../GeneratedArtifacts/viewModel.js" />
myapp.AddEditCustomer.created = function (screen) {
    // Set the screen title dynamically
    var name;
    name = screen.Customer.ContactName;
    screen.details.displayName = "Info: " + name;
};

myapp.AddEditCustomer.beforeApplyChanges = function (screen) {
    if (screen.Customer.ContactName.indexOf('!') != -1) {
        screen.findContentItem("ContactName").validationResults = [
        new msls.ValidationResult(
        screen.Customer.details.properties.ContactName,
        "Contact Name cannot contain the character '!'.")
        ];
        return false;
    }
};